<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!-- Copyright 1997 The Open Group, All Rights Reserved -->
<title>scalb</title>
</head><body bgcolor=white>
<center>
<font size=2>
The Single UNIX &reg; Specification, Version 2<br>
Copyright &copy; 1997 The Open Group

</font></center><hr size=2 noshade>
<h4><a name = "tag_000_008_153">&nbsp;</a>NAME</h4><blockquote>
scalb - load exponent of a radix-independent floating-point number
</blockquote><h4><a name = "tag_000_008_154">&nbsp;</a>SYNOPSIS</h4><blockquote>
<pre><code>

#include &lt;<a href="math.h.html">math.h</a>&gt;

double scalb(double <i>x</i>, double <i>n</i>);
</code>
</pre>
</blockquote><h4><a name = "tag_000_008_155">&nbsp;</a>DESCRIPTION</h4><blockquote>
The
<i>scalb()</i>
function computes <i>x</i> * <i>r<small><sup>n</sup></small></i>,
where <i>r</i> is the radix of the machine's floating point arithmetic.
When <i>r</i> is 2,
<i>scalb()</i>
is equivalent to
<i><a href="ldexp.html">ldexp()</a></i>.
<p>
An application wishing to check for error situations should set
<i>errno</i>
to 0 before calling
<i>scalb()</i>.
If
<i>errno</i>
is non-zero on return, or the return value is NaN, an error has occurred.
</blockquote><h4><a name = "tag_000_008_156">&nbsp;</a>RETURN VALUE</h4><blockquote>
Upon successful completion, the
<i>scalb()</i>
function returns <i>x</i> * <i>r<small><sup>n</sup></small></i>.
<p>
If the correct value would overflow,
<i>scalb()</i>
returns &plusmn;HUGE_VAL
(according to the sign of x</i>) and sets <i>errno</i> to [ERANGE].
<p>
If the correct value would underflow,
<i>scalb()</i>
returns 0 and sets <i>errno</i> to [ERANGE].
<p>
The
<i>scalb()</i>
function returns <i>x</i> when <i>x</i> is &plusmn;Inf.
<p>
If <i>x</i> or <i>n</i> is NaN, then
<i>scalb()</i>
returns NaN and may set <i>errno</i> to [EDOM].
</blockquote><h4><a name = "tag_000_008_157">&nbsp;</a>ERRORS</h4><blockquote>
The
<i>scalb()</i>
function will fail if:
<dl compact>

<dt>[ERANGE]<dd>
The correct value would overflow or underflow.

</dl>
<p>
The
<i>scalb()</i>
function may fail if:
<dl compact>

<dt>[EDOM]<dd>
The <i>x</i> or <i>n</i> argument is NaN.

</dl>
</blockquote><h4><a name = "tag_000_008_158">&nbsp;</a>EXAMPLES</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_008_159">&nbsp;</a>APPLICATION USAGE</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_008_160">&nbsp;</a>FUTURE DIRECTIONS</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_008_161">&nbsp;</a>SEE ALSO</h4><blockquote>
<i><a href="ldexp.html">ldexp()</a></i>,
<i><a href="math.h.html">&lt;math.h&gt;</a></i>.
</blockquote><hr size=2 noshade>
<center><font size=2>
UNIX &reg; is a registered Trademark of The Open Group.<br>
Copyright &copy; 1997 The Open Group
<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]

</font></center><hr size=2 noshade>
</body></html>
